package com.zuoye.dey03;

import java.io.*;
import java.util.ArrayList;

public class Demo {
    public static void main(String[] args) throws IOException {
        BufferedWriter bw = new BufferedWriter(new FileWriter("dey11\\src\\com\\zuoye\\dey03\\aaa.txt"));
        ArrayList<Student> list = new ArrayList<>();
        list.add(new Student("张三", "23", "男", "76"));
        list.add(new Student("李四", "33", "男", "15"));
        list.add(new Student("王五", "12", "女", "73"));
        list.add(new Student("赵六", "34", "男", "63"));
        list.add(new Student("周七", "21", "女", "34"));
        for (Student s : list) {
            bw.write(s.getName() + "," + s.getAge() + "," + s.getGender() + "," + s.getGrade());
            bw.newLine();
            bw.flush();
        }
        bw.close();
    }
}
